package com.app.brilliant.util;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class MathUtil {
    public static int getRangeValue(int min,int max){
        Random random = new Random();
        int value = random.nextInt(max+1-min)+min;
        return value;
    }

    public static <T> List<T> getRandSizeList(List<T> list, int size){
        if(size>list.size()){
            return list;
        }
        List<T> all = new ArrayList<T>();
        for(int i = 0;i<size;i++){
            int randomIndex = (int) (Math.random()*list.size());
            all.add(list.remove(randomIndex));
        }
        return all;
    }
}
